home *** CD-ROM | disk | FTP | other *** search
/ CBM Funet Archive / cbm-funet-archive-2003.iso / cbm / demodisks / drives / 1581-demo.lzh / auto-boot 128 (.txt) next >
Commodore BASIC  |  1994-10-19  |  2KB  |  89 lines

  1. 100 print"[147][155]  [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  2. 102 print"       [159]auto-boot maker"
  3. 104 print"[155]  [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  4. 105 poke53280,0:poke53281,0:rem by bowen&ryan
  5. 106 x=peek(48):if(x>=8)then1990
  6. 107 gosub2125
  7. 108 nu$=chr$(0)
  8. 110 :  input#15,a,aa$,c,d:if(a>0)thengosub242:goto100
  9. 112 open8,u,8,"#"
  10. 114 print#15,"u1:8 0 18 0":print#15,"b-p";8;5
  11. 116 :  get#8,ba$:bl$=""
  12. 118 print#15,"u1:8 0 1 0":input#15,a,aa$,c,d:ifa<>0thengosub242:goto100
  13. 120 :  fori=0to24: get#8,a$: bl$=bl$+chr$(asc(a$)): next
  14. 122 if (asc(ba$)and1)=0 then (NULL)
  15. 124 :  if left$(bl$,3)="cbm" then (NULL)
  16. 126 :     print"    [155] already a boot disk:      ":print"";
  17. 128 :     i=8
  18. 130 :     (NULL)
  19. 132 :        a$=mid$(bl$,i,1)
  20. 134 :        printa$;
  21. 136 :        i=i+1
  22. 138 :        (NULL) (NULL) a$=nu$
  23. 140 :    print
  24. 142 :    (NULL): (NULL) (NULL)
  25. 144 :     print"    [155] boot  sector  used        "
  26. 146 :     print" by  another  program      "
  27. 148 :    (NULL)
  28. 150 : print"    [155] continue (y/n)            ":input"n[157][157][157]";a$
  29. 152 : if a$<>"y" then e=-1: goto238
  30. 154 : ba = -1
  31. 156 (NULL)
  32. 158 print"    [155] enter your program's name "
  33. 160 print"     (up to 16 characters)     "
  34. 162 input"      startup[157][157][157][157][157][157][157][157][157]";f$
  35. 164 :
  36. 166 iflen(f$)>16 then (NULL)
  37. 168 :  print"     that's too big!";
  38. 170 :  (NULL)2
  39. 172 :  goto162
  40. 174 :  (NULL)
  41. 176 iff$=""thenend
  42. 178 :
  43. 180 print"[155] enter your program's type "
  44. 182 print" ('basic' or 'binary')     "
  45. 184 input"  basic[157][157][157][157][157][157][157]";t$
  46. 186 :
  47. 188 if t$<>"basic" and t$ <> "binary" then (NULL)
  48. 190 :  print"     enter 'basic' or 'binary'";
  49. 192 :  (NULL)2
  50. 194 :  print"[145][145][145]"chr$(27)"@[145]"
  51. 196 :  goto184
  52. 198 :  (NULL)
  53. 200 if t$="basic" then rm$="run" : (NULL) rm$="boot"
  54. 202 :
  55. 204 print"[155] insert  your  disk  into  "
  56. 206 print" drive "u"[157].  press  return  "
  57. 208 print" when  ready.              ";
  58. 210 get(NULL)a$: if asc(a$)<>13 then e=-1: goto238
  59. 212 :
  60. 214 aa= len(f$)+(NULL)("b00")+15
  61. 216 al= aa and 255:   ah= aa / 256
  62. 218 :
  63. 220 print#15,"b-p 8 0"
  64. 222 print#8, "cbm";nu$;nu$;nu$;nu$;f$;nu$;nu$;
  65. 224 print#8, chr$(162);chr$(al);chr$(160);chr$(ah);
  66. 226 print#8, chr$(76);chr$((NULL)("a5"));chr$((NULL)("af"));
  67. 228 print#8, rm$;chr$(34);f$;nu$
  68. 230 print#15, "u2:8 0 1 0"
  69. 232 if ba=0 then print#15, "b-a 0 1 0"
  70. 234 a$=ds$:ifds>0thengosub242:goto100
  71. 236 :
  72. 238 close8: close15
  73. 240 end
  74. 242 print:print"[155] disk error:               ":close8:close15
  75. 244 print""a","aa$","c","d:e=-1:print"[155]press any key to continue":get(NULL)g$:return
  76. 1990 print"[155]sorry, this program will"
  77. 1992 print"run on the c-128 only.":end
  78. 2000 rem
  79. 2010 rem
  80. 2125 print "[155] disk unit nr (8-15)       "
  81. 2130 input"8[157][157][157]";u: if u<8 or u>15 then print "[145][145][145][145]": goto 125
  82. 2155 print "[155] insert disk in unit"u"[157], d"right$(str$(d),1)";"
  83. 2160 print " press any key when ready. "
  84. 2165 get x$: if x$=""then2165
  85. 2166 open15,u,15,"i0"
  86. 2170 print"[145][145][145][145][145][145][145]":bl$="                                   "
  87. 2175 printbl$:printbl$:printbl$:printbl$:printbl$:printbl$:print"[145][145][145][145][145][145][145]"
  88. 2180 return
  89.